﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/AdminCP/Views/Shared/ViewMasterPage1.Master"
    Inherits="System.Web.Mvc.ViewPage<InfoTech.Mvc.LanTranh.MucVu.Models.HOGIADINHModel>" %>

<%@ Import Namespace="InfoTech.LanTranh.MucVu.Service" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-box addHoGiaDinh">
        <div class="content-box-header">
            <h3>
                Cập Nhật Hộ Gia Đình</h3>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <%
                Html.EnableClientValidation(); %>
            <% 
                using (Html.BeginForm())
                {%>
            <%: Html.ValidationSummary() %>
            <%:Html.HiddenFor(c=>c.MAHOGIADINH) %>
            <table cellpadding="3" cellspacing="3">
                <tr>
                    <td class="title" colspan="5">
                        Thông Tin Hộ Gia Đình
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td colspan="5">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Mã Hộ Gia Đình
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.HOGIADINHID, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.HOGIADINHID, "(*)")%>
                        </div>
                    </td>
                    <td width="10">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle">
                        &nbsp;
                    </td>
                    <td>
                        <span style="font-weight: bold; font-size: 19px; color: brown;">
                            <%=Model.MAHO%>
                        </span>
                        <%:Html.HiddenFor(c => c.MAHO)%>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Tên Chủ Hộ:
                    </td>
                    <td>
                        <div class="editor-field">
                            <%:Html.HiddenFor(c=>c.HOGIADINHID) %>
                            <div class="editor-field">
                                <%:Html.HiddenFor(c=>c.MACHUHO) %>
                                <%:Html.HiddenFor(c=>c.TENCHUHO) %>
                                <%if (!string.IsNullOrEmpty(Model.TENCHUHO))
                                  {
                                %><%=Html.ActionLink(Model.TENCHUHO,"EditGiaoDan",new {id=Model.MACHUHO})%><%
                              } %>
                            </div>
                            </span>
                        </div>
                    </td>
                    <td width="10">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle">
                        Hoàn Cảnh Kinh Tế
                    </td>
                    <td>
                        <%:Html.DropDownListFor(c=>c.MAHOANCANHKINHTE,HOANCANHKINHTEService.Get_List(), new { style = "width: 250px", @class="text-input" })%>
                        <%: Html.ValidationMessageFor(model => model.MAHOANCANHKINHTE, "(*)")%>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Địa Chỉ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.DIACHI, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.DIACHI, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Điện Thoại
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.DIENTHOAI, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.DIENTHOAI, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Email
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.EMAIL, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.EMAIL, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Fax
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.FAX, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.FAX, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="title" colspan="5">
                        Thông Tin Mục Vụ
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Giáo Phận
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAGIAOPHAN,GIAOPHANService.Get_List(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAGIAOPHAN, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Giáo Hạt
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAGIAOHAT,GIAOHATService.Get_List_Join_GiaoPhan(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAGIAOHAT, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Giáo Xứ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAGIAOXU,GIAOXUService.Get_List_Join_GiaoPhan_GiaoHat(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAGIAOXU, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Giáo Họ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAGIAOHO,GIAOHOService.Get_List_Join_GiaoPhan_GiaoHat_GiaoXu(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAGIAOHO, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="title" colspan="5">
                        Thông Tin Hành Chính
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Quốc Gia
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAQUOCGIA,QUOCGIAService.Get_List(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAQUOCGIA, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Tỉnh Thành
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MATINHTHANH,TINHTHANHService.Get_List_Join_Country(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MATINHTHANH, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Quận Huyện
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAQUANHUYEN,QUANHUYENService.Get_List_Join_City_Country(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAQUANHUYEN, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Xã Phường
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.DropDownListFor(model => model.MAXAPHUONG,XAPHUONGService.Get_List_Join_City_Country_District(), new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAXAPHUONG, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td>
                        <input type="submit" value="Cập nhật Hộ Gia Đình" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                    </td>
                </tr>
            </table>
            <% } %>
        </div>
        <!-- End .content-box-content -->
    </div>
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Nhân Khẩu</a></li>
            <li><a href="#tabs-2">Đã Cư Ngụ</a></li>
        </ul>
        <div id="tabs-1">
        </div>
        <div id="tabs-2">
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
             $.ajaxSetup ({
// Disable caching of AJAX responses
                cache: false
            });
            $("#tabs").wijtabs({ showOption: {
                blind: true,
                duration: 400
            }, hideOption: {
                blind: true,
                duration: 400
            }, cache: false
            , select: function (event, ui) {
                SelectedTabsChange(ui.index);
            }
            });
            if ("#tabs-2" == self.document.location.hash)
                SelectedTabsChange(1);
            //            else if ("#tabs-3" == self.document.location.hash)
            //                SelectedTabsChange(2);
            //            else if ("#tabs-4" == self.document.location.hash)
            //                SelectedTabsChange(3);
            //            else if ("#tabs-5" == self.document.location.hash)
            //                SelectedTabsChange(4);
            //            else if ("#tabs-6" == self.document.location.hash)
            //                SelectedTabsChange(5);
            //            else if ("#tabs-7" == self.document.location.hash)
            //                SelectedTabsChange(6);
            else
                SelectedTabsChange(0);
        });
        function SelectedTabsChange(id){
            loadingPanel.show();
            if (id == 1){
                $("#tabs-2").load("<%= Url.Action("ViewUserControl_DaCuNgu","GiaDinhCongGiao",new {id=Model.MAHOGIADINH}) %>",function(){                    
                    LoadCuNgu();
                    loadingPanel.hide();
                });
            }
            else if(id==0){
                $("#tabs-1").load("<%= Url.Action("ViewUserControl_NhanKhau","GiaDinhCongGiao",new {id=Model.MAHOGIADINH}) %>",function(){                      
                        LoadNhanKhau();
                        loadingPanel.hide();                        
                    });
            }
            else
                loadingPanel.hide();             
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderCss" runat="server">
    <link href="<%=Html.AreaCssPath("AdminCP") %>themes/wijmo/jquery.ui.wijtabs.css"
        rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderScript" runat="server">
    <script src="<%=Html.AreaScriptPath("AdminCP") %>wijmo/jquery.ui.wijtabs.js" type="text/javascript"></script>
    <script type="text/javascript" src="<%=Html.AreaScriptPath("AdminCP") %>MucVu.js"></script>
    <script type="text/javascript" src="<%=Html.AreaScriptPath("AdminCP") %>HanhChinh.js"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#MAGIAOPHAN").change(function () {
                Change_GiaoPhan('addHoGiaDinh', '<%=Url.Action("Get_GIAOHAT","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAGIAOHAT").change(function () {
                Change_GiaoHat('addHoGiaDinh', '<%=Url.Action("Get_GIAOXU","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAGIAOXU").change(function () {
                Change_GiaoXu('addHoGiaDinh', '<%=Url.Action("Get_GIAOHO","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAQUOCGIA").change(function () {
                Change_QuocGia('addHoGiaDinh', '<%=Url.Action("Get_TINHTHANH","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MATINHTHANH").change(function () {
                Change_TinhThanh('addHoGiaDinh', '<%=Url.Action("Get_QUANHUYEN","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAQUANHUYEN").change(function () {
                Change_QuanHuyen('addHoGiaDinh', '<%=Url.Action("Get_XAPHUONG","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
        });
    </script>
</asp:Content>
